/**
 * 版权所有：厦门市巨龙信息科技有限公司
 * Copyright 2024 Xiamen Dragoninfo Eng. Co. Ltd.
 * All right reserved.
 */
package com.github.alfred.ddd.core.gateway.acl.adpater;

import com.github.alfred.ddd.core.event.Event;
import com.github.alfred.ddd.core.gateway.acl.port.EventPublisher;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

/**
 * 类说明
 *
 * @author chengh
 * @date 2024/1/11 17:04
 */

@Component
public class EventSpringPublisher<T> implements EventPublisher {

    private final ApplicationContext applicationContext;

    public EventSpringPublisher(ApplicationContext applicationContext) {
        this.applicationContext = applicationContext;
    }

    @Override
    public void publish(Event event) {
        applicationContext.publishEvent(event);
    }
}
